package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.bean.PageConfigItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface PageConfigItemMapper extends BaseMapper<PageConfigItem> {


    @Delete("DELETE FROM page_config_item WHERE page_config_id = #{pageConfigId}")
    void deleteByPageConfigId(@Param("pageConfigId") Integer pageConfigId);

    @Select("SELECT * FROM page_config_item WHERE page_config_id = #{pageConfigId} ORDER BY order_index ASC")
    List<PageConfigItem> selectByPageConfigId(@Param("pageConfigId") Integer pageConfigId);
}
